package ma.zhiqiang.dataline.connector.transform;

import ma.zhiqiang.dataline.core.dto.ColumnMap;
import ma.zhiqiang.dataline.core.dto.SinkRecord;
import ma.zhiqiang.dataline.core.dto.SourceRecord;
import ma.zhiqiang.dataline.core.engine.Transform;

/**
 * 仅将SourceRecord透传
 */
public class NoneTransform implements Transform {
    //
    @Override
    public SinkRecord transfer(SourceRecord sourceRecord) {
        if(null!=sourceRecord.getStr()){return new SinkRecord(String.class,sourceRecord.getStr());}
        if(null!=sourceRecord.getColumnMap()){return new SinkRecord(ColumnMap.class,sourceRecord.getColumnMap());}
        return null;
    }
}
